package nju.mscs.data.object;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;

public class SaleRecord implements Serializable{
	protected Bill currentBill;
	protected ArrayList<Bill> billList = new ArrayList<Bill>(); 
	public void addRecord(Bill bill) {
	}
	
	public Bill createNewBill(String id,VipConsumer vip,User cashier){
		currentBill = new Bill(id, vip, cashier);
		billList.add(currentBill);
		return currentBill;
	}
	public Bill getCurrentBill() {
		return currentBill;
	}
	public Bill searchBill(String id){
		Bill result=null;
		for(Bill bill:billList){
			if(bill.getId().equals(id)){
				result=bill;
				break;
			}
		}
		return result;
	}
}
